home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / Samples / RAVE Starter Samples / RAVE Common Code / RAVE Utilities.h < prev   
Encoding:
C/C++ Source or Header  |  1998-04-30  |  2.8 KB  |  80 lines  |  [TEXT/CWIE]

  1. /*****************************************************************************
  2.  
  3. RAVE Utilities.h
  4.  
  5. RAVE Utilities defines a number of useful functions for working with RAVE,
  6. including functions to find the deepest GDevice, loading textures from a PICT
  7. resource, and so on. Essentially, it defines a number of pieces of common code
  8. that were useful to many of my projects.
  9.  
  10. Author: Timothy Carroll
  11. Apple Developer Technical Support
  12. devsupport@apple.com
  13.  
  14. Modification History: 
  15. 5/1/98        TMC     Initial Release
  16.  
  17. Copyright © 1998 Apple Computer, Inc., All Rights Reserved
  18.  
  19. You may incorporate this sample code into your applications without
  20. restriction, though the sample code has been provided "AS IS" and the
  21. responsibility for its operation is 100% yours.  However, what you are
  22. not permitted to do is to redistribute the source as "DSC Sample Code"
  23. after having made changes. If you're going to re-distribute the source,
  24. we require that you make it clear in the source that the code was
  25. descended from Apple Sample Code, but that you've made changes.
  26.  
  27. *****************************************************************************/
  28.  
  29. #ifndef _RAVEUTILITIES_
  30. #define _RAVEUTILITIES_
  31.  
  32. #pragma once
  33.  
  34. #include <RAVE.h>
  35. #include "Common Stuff.h"
  36.  
  37.  
  38. /*****************************************************************************
  39. LOOKUP TABLES
  40.  
  41. I use SIN and COS in a number of places, and we don't need perfect precision,
  42. so we generate a set of lookup tables on 0.5 degree increments.  Most of the
  43. 3D math routines use these lookups to generate matrices.
  44. *****************************************************************************/
  45.  
  46. extern float gSinArray[721]; // [720] = [0]
  47. extern float gCosArray[721]; // [720] = [0]
  48.  
  49. OSStatus InitializeLookups(void);
  50.  
  51.  
  52. /*****************************************************************************
  53. RAVE ENGINE FUNCTIONS
  54.     
  55. FindTextureMappingEngine walks the list of available engines and returns
  56. the first engine capable of Texture Mapping.
  57.  
  58. GetListOfEngines creates a handle filled with references to all engines
  59. available to the application.    
  60. *****************************************************************************/
  61.  
  62. TQAEngine    *FindTextureMappingEngine (TQADevice *device);
  63. OSStatus    GetListOfEngines (GDHandle screen, Handle *list, long *number);
  64.  
  65.  
  66. /*****************************************************************************
  67. TEXTURES
  68.  
  69. LoadTextureFromPictResource loads a PICT resource, draws it into an offscreen
  70. GWorld, creates a RAVE texture, and then detaches it so that the engine is
  71. responsible for managing it.  Complete texture management code would probably
  72. want to make sure that the textures are also available as a GWorld, so that
  73. they can be quickly loaded and unloaded from the card.
  74. *****************************************************************************/
  75.  
  76. TQATexture    *LoadTextureFromPictResource (TQAEngine *engine, short pictID);
  77.  
  78.  
  79. #endif _RAVEUTILITIES_
  80.